package com.thread.www;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.TimeUnit;

/**
 * @author 新技术软件：汪洋
 */
public class MonitorThreadPoolExecutorTest {
    public static void main(String[] args) throws InterruptedException {
        Thread.sleep(1000);
        ExecutorService excutor = new MonitorThreadPoolExecutor(5 , 5 , 0 , TimeUnit.MILLISECONDS , new LinkedBlockingDeque());
        for(int i =0;i<3;i++){
            Runnable runnable = new Runnable() {
                @Override
                public void run() {
                    try{
                        Thread.sleep(100);
                    }catch (InterruptedException e){
                        e.printStackTrace();
                    }
                }
            };
            excutor.execute(runnable);
        }
        excutor.shutdown();
        System.out.println("Thread Main End");
    }
}
